<template>
  <div class="success">
    <header>
      <img src="@/assets/images/success/success.png">
      <div class="title">{{title}}</div>
      <div class="dsc">{{dsc}}</div>
      <div class="button-list">
        <div class="button get-back">
          <button @click="getBack">返回</button>
        </div>
        <div class="button">
          <button @click="operation">{{buttonText}}</button>
        </div>
      </div>
    </header>
    <!--<section>
      &lt;!&ndash;罚款缴纳 start&ndash;&gt;
      <div class="penalty flex-justify-center-between">
        <div class="left">
          <div class="title">
            <img src="@/assets/images/success/car.png"><span>违章罚款缴纳</span>
          </div>
          <div class="dsc">违章处理后，线上缴纳罚款</div>
        </div>
        <i class="iconfont">&#xe651;</i>
      </div>
      &lt;!&ndash;罚款缴纳 end&ndash;&gt;

      &lt;!&ndash;优惠卷 start&ndash;&gt;
      <div class="coupons flex-justify-center-between">
        <div class="left">
          <div class="title">
            <img src="@/assets/images/success/coupons.png"><span>您获得了一张生活缴费优惠券</span>
          </div>
        </div>
        <div class="button-white">
          <button>领取</button>
        </div>
      </div>
      &lt;!&ndash;优惠卷 end&ndash;&gt;

      &lt;!&ndash;广告 end&ndash;&gt;
      <swipe :list="list"></swipe>
      &lt;!&ndash;广告 end&ndash;&gt;

      <div class="your-correlation">
        <div class="color-lump-title">和您相关</div>
        <div class="list-item flex-stretch">
          <div class="left"><img src="@/assets/images/success/correlation.png"></div>
          <div class="right">
            <div class="title">注意啦！即日起许昌市取消机动车进城市限制</div>
            <div class="dsc"><span>最新政策</span><span>2019-09-25 09:00</span></div>
          </div>
        </div>
        <div class="list-item flex-stretch">
          <div class="left"><img src="@/assets/images/success/correlation.png"></div>
          <div class="right">
            <div class="title">注意啦！即日起许昌市取消机动车进城市限制</div>
            <div class="dsc"><span>最新政策</span><span>2019-09-25 09:00</span></div>
          </div>
        </div>
      </div>
    </section>-->
  </div>
</template>
<!--成功页-->
<script>
  import Swipe from '@/components/swipe';

  export default {
    name: 'success',

    props: {
      // 主标题
      title: {
        type: String,
        required: true
      },
      // 描述
      dsc: {
        type: String,
        required: true
      },
      // 右边按钮文案
      buttonText: {
        type: String,
        required: true
      }
    },

    components: {
      Swipe
    },

    data () {
      return {
        list: [
          {
            openLink: '',
            imgPath: require('../../assets/images/success/hint.png')
          }
        ]
      }
    },

    methods: {
      // 返回
      getBack () {
        this.$emit('getBack')
      },

      // 操作
      operation () {
        this.$emit('operation')
      }
    }
  }
</script>

<style scoped lang="scss">
  @import "~styles/extends";

  .success {
    width: 100%;
    header {
      text-align: center;
      padding: 36px 16px 0;

      img {
        width: 60px;
        height: 60px;
      }

      .title {
        font-size: 18px;
        font-weight: bold;
        line-height: 25px;
        margin-top: 20px;
      }

      .dsc {
        font-size: 14px;
        font-family: PingFangSC-Regular;
        font-weight: 400;
        color: $theme-gray;
        line-height: 20px;
        margin-top: 4px;
      }

      .button-list {
        display: flex;
        justify-content: center;
        margin-top: 36px;
        padding-bottom: 36px;

        .button {
          width: 130px;

          button {
            font-weight: bold;
          }
        }

        .get-back {
          margin-right: 16px;

          button {
            background: $theme-white;
            color: $theme-blue;
            border: 1px solid $theme-blue;
          }
        }
      }
    }

    section {
      padding: 16px 16px 36px;

      .penalty {
        i {
          color: $theme-gray;
        }
      }

      .coupons {
        padding-top: 16px;

        .button-white {
          button {
            padding: 4px 12px;
            font-size: 14px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            line-height: 20px;
          }
        }
      }

      .swiper-container {
        margin: 20px 0;
      }

      .flex-justify-center-between {
        @extend %flex-justify-center-between;
        padding-bottom: 16px;
        border-bottom: 1px solid $theme-border-color;
      }

      .left {
        font-family: PingFangSC-Regular;
        font-weight: 400;

        .title {
          @extend %flex;
          align-items: center;
          font-size: 16px;
          line-height: 22px;

          img {
            width: 20px;
            height: 20px;
            margin-right: 8px;
          }
        }

        .dsc {
          font-size: 12px;
          color: $theme-gray;
          line-height: 17px;
          margin-top: 4px;
        }
      }

      .your-correlation {
        .list-item {
          margin-top: 16px;
          padding-bottom: 16px;
          border-bottom: 1px solid $theme-border-color;

          .left {
            margin-right: 16px;

            img {
              width: 100px;
              height: 80px;
            }
          }

          .right {
            font-family: PingFangSC-Regular;
            font-weight: 400;

            .title {
              font-size: 16px;
              line-height: 22px;
            }

            .dsc {
              font-size: 12px;
              color: $theme-gray;
              line-height: 17px;
              @extend %flex-justify-between
            }
          }
        }

        .list-item:last-child {
          border-bottom: 0;
          padding-bottom: 0;
        }
      }
    }
  }
</style>
